package com.jyxd.web.data.basic;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 医嘱备份表
 */
@Entity
@Table(name = "table_med_order_backup_exec")
@Data
@ApiModel("储存一些过去的以前的医嘱数")
public class MedOrderBackupsExec implements Serializable {

    /**
     * 序列
     */
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @Id
    @Column(name = "id", length = 32, nullable = false)
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid.hex")
    private String id;

    /**
     * 住院号
     */
    @Column(name = "visit_id")
    private String visitId;

    /**
     * 本次住院号
     */
    @Column(name = "visit_code")
    private String visitCode;

    /**
     * 病人主键id
     */
    @Column(name = "patient_id")
    private String patientId;

    /**
     * 医嘱编码（同步时使用）(唯一)
     */
    @Column(name = "order_code")
    private String orderCode;

    /**
     * 医嘱同批次主键 (分组)
     */
    @Column(name = "order_no")
    private String orderNo;

    /**
     * 子医嘱主键 （单个）
     */
    @Column(name = "order_sub_no")
    private String orderSubNo;

    /**
     * 医嘱名称
     */
    @Column(name = "order_name")
    private String orderName;

    /**
     * 规格
     */
    @Column(name = "specs")
    private String specs;

    /**
     * 是否为药嘱（0：否  1：是）
     */
    @Column(name = "drug_type")
    private int drugType;

    /**
     * 补液类型（如：晶体液、胶体液等）
     */
    @Column(name = "order_attr")
    private String orderAttr;

    /**
     * 计划执行时间
     */
    @Column(name = "default_time_point")
    private Date defaultTimePoint;

    /**
     * 医嘱实际执行日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Column(name = "execute_data")
    private Date executeDate;

    /**
     * 医嘱执行时间点
     */
    @Column(name = "execute_time_interval")
    private String explicitTimeInterval;

    /**
     * 医嘱用药天数
     */
    @Column(name = "duration")
    private String duration;

    /**
     * 医嘱开始执行时间
     */
    @Column(name = "start_time_point")
    private Date startTimePoint;

    /**
     * 执行完成时间
     */
    @Column(name = "complete_time_point")
    private Date completeTimePoint;

    /**
     * 录入医嘱时间
     */
    @Column(name = "entry_time")
    private Date entryTime;

    /**
     * 药品一次使用量
     */
    @Column(name = "dosage")
    private String dosage;

    /**
     * 剂量数量
     */
    @Column(name = "quantity")
    private String quantity;

    /**
     * 剂量数量单位
     */
    @Column(name = "quantity_units")
    private String quantityUnits;

    /**
     * 单位
     */
    @Column(name = "dosage_units")
    private String dosageUnits;

    /**
     * 执行总量
     */
    @Column(name = "all_dosage")
    private String allDosage;

    /**
     * 医嘱执行次数
     */
    @Column(name = "total_number")
    private String totalNumber;

    /**
     * 医嘱类型，0：临时医嘱；1：长期医嘱
     */
    @Column(name = "repeat_indicator")
    private int repeatIndicator;

    /**
     * 给药途径
     */
    @Column(name = "use_mode")
    private String useMode;

    /**
     * 用药类别
     */
    @Column(name = "class_type")
    private String classType;

    /**
     * 频次，如：qd,tid等
     */
    @Column(name = "frequency")
    private String frequency;

    @Column(name = "frequency_end_time")
    private Date frequencyEndTime;

    /**
     * 流速
     */
    @Column(name = "perform_speed")
    private String performSpeed;

    /**
     * 流速单位
     */
    @Column(name = "speed_units")
    private String speedUnits;

    /**
     * 责任护士编码
     */
    @Column(name = "nurse_code")
    private String nurseCode;

    /**
     * 医嘱状态代码  执行状态，V：核实；U：作废；H：ON Hold；D：停止 P：预开 E：执行 Q: In Queue
     * PO : Post-Operation Order S :Postponed
     * I:未审核 IP：处理中 C：撤销
     */
    @Column(name = "order_status")
    private String orderStatus;

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark;

    /**
     * 嘱托
     */
    @Column(name = "doctor_advice")
    private String doctorAdvice;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 记录最后修改时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 是否已同步到护理单，0：未同步；1：已同步；
     */
    @Column(name = "is_sync")
    private int isSync;

    /**
     * 医嘱每天执行总次数 默认1
     */
    @Column(name = "order_exec_num")
    private int orderExecNum;

    /**
     * 剩余同步次数 默认1
     */
    @Column(name = "sync_num")
    private int syncNum;

    /**
     * 最新同步时间
     */
    @Column(name = "recent_sync_time")
    private Date recentSyncTime;

    /**
     * 药品IDM代码
     */
    @Column(name = "idm")
    private String idm;

    /**
     * 剂型代码
     */
    @Column(name = "dosage_form")
    private String dosageForm;

    /**
     * 规格
     */
    @Column(name = "coefficient")
    private String coefficient;

    /**
     * 用法用量
     */
    @Column(name = "treatment_route")
    private String treatmentRoute;

    /**
     * 删除状态
     */
    @Column(name = "status")
    private String status;
}
